Remove gpssim formet per 02/28/2022 proposal. (#1028)
authorRobert Lipe <robertlipe@users.noreply.github.com>
Tue, 7 Mar 2023 02:47:51 +0000 (20:47 -0600)
committerGitHub <noreply@github.com>
Tue, 7 Mar 2023 02:47:51 +0000 (20:47 -0600)
12 files changed:
CMakeLists.txt
deprecated/gpssim.cc [new file with mode: 0644]
gpssim.cc [deleted file]
reference/format0.txt
reference/format1.txt
reference/format2.txt
reference/format3.txt
reference/help.txt
testo.d/gpssim.test [deleted file]
vecs.cc
xmldoc/formats/gpssim.xml [deleted file]
xmldoc/formats/options/gpssim-split.xml [deleted file]

index ea6100cc3efb99b0b9dd9bbe2d7adb4be6a240b8..6171b292811638855a6d0f967b03f9ad3a2b2ff8 100644 (file)
@@ -90,7 +90,6 @@ set(ALL_FMTS ${MINIMAL_FMTS}
   geocache.cc
   geojson.cc
   globalsat_sport.cc
-  gpssim.cc
   gtm.cc
   gtrnctr.cc
   holux.cc
@@ -396,7 +395,6 @@ set(TESTS
   geo
   globalsat_sport
   gpsdrive
-  gpssim
   gpx
   grapheme
   gtm
diff --git a/deprecated/gpssim.cc b/deprecated/gpssim.cc
new file mode 100644 (file)
index 0000000..322564b
--- /dev/null
@@ -0,0 +1,201 @@
+/*
+    Write points to Franson Technology GpsGate simulator
+
+    Copyright (C) 2006  Robert Lipe, robertlipe+source@gpsbabel.org
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+ */
+
+
+#include "defs.h"
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include "nmea.h"
+
+#define MYNAME "gpssim"
+
+static gbfile* fout;
+static char* wayptspd;
+static char* splitfiles_opt;
+static int splitfiles;
+static QString fnamestr;
+static int trk_count;
+static int doing_tracks;
+
+static
+QVector<arglist_t> gpssim_args = {
+  {
+    "wayptspd", &wayptspd, "Default speed for waypoints (knots/hr)",
+    nullptr, ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
+  },
+  {
+    "split", &splitfiles_opt, "Split input into separate files",
+    "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
+  },
+};
+
+/*
+ * The only thing kind of odd about this format is the "split"
+ * option.  There's some trashing about with the 'splitfiles' toggle
+ * to ensure that waypoints land in one file and each track and each
+ * route land in files of their own.
+ */
+
+static void
+gpssim_wr_init(const QString& fname)
+{
+  fnamestr =  fname;
+  trk_count = 0;
+  splitfiles = splitfiles_opt ? xstrtoi(splitfiles_opt, nullptr, 10) : 0;
+
+  /* If writing to stdout, never split files */
+  if (0 == strcmp("-",splitfiles_opt)) {
+    splitfiles = 0;
+  }
+
+  if (!splitfiles) {
+    fout = gbfopen(fname, "wb", MYNAME);
+  }
+}
+
+static void
+gpssim_wr_deinit()
+{
+  if (fout) {
+    gbfclose(fout);
+    fout = nullptr;
+  }
+
+  fnamestr.clear();
+}
+
+
+/*
+ * All these files are written in binary mode, so put CR/NL pairs
+ * in them explictly in case we're writing from a UNIX-like host.
+ */
+
+static void
+gpssim_write_sentence(const char* const s)
+{
+  gbfprintf(fout, "$%s*%02X\r\n", s, NmeaFormat::nmea_cksum(s));
+}
+
+static void
+gpssim_write_spd(double knotsperhour)
+{
+  char obuf[1024];
+
+  snprintf(obuf, sizeof(obuf), "FRSPD,%.2f", knotsperhour);
+  gpssim_write_sentence(obuf);
+}
+
+static void
+gpssim_write_pt(const Waypoint* wpt)
+{
+  char obuf[1024];
+
+  if (wpt->speed_has_value()) {
+    gpssim_write_spd(MPS_TO_KNOTS(wpt->speed_value()));
+  }
+
+  double lat = degrees2ddmm(wpt->latitude);
+  double lon = degrees2ddmm(wpt->longitude);
+
+  snprintf(obuf, sizeof(obuf), "FRWPT,%10.5f,%c,%011.5f,%c,%.1f",
+           fabs(lat), lat < 0 ? 'S' : 'N',
+           fabs(lon), lon < 0 ? 'W' : 'E',
+           wpt->altitude == unknown_alt ? 0 : wpt->altitude
+          );
+
+  if (wpt->creation_time.isValid()) {
+    char tbuf[20];
+
+    QByteArray dmy = wpt->GetCreationTime().toUTC().toString(u"ddMMyy").toUtf8();
+    QByteArray hms = wpt->GetCreationTime().toUTC().toString(u"hhmmss").toUtf8();
+
+    snprintf(tbuf, sizeof(tbuf), ",%s,%s",dmy.constData(), hms.constData());
+    strcat(obuf, tbuf);
+  }
+
+  gpssim_write_sentence(obuf);
+}
+
+static void
+gpssim_trk_hdr(const route_head* rh)
+{
+  if (splitfiles) {
+
+    if (fout) {
+      fatal(MYNAME ": output file already open.\n");
+    }
+
+    QString ofname = QStringLiteral("%1%2%3.gpssim").arg(fnamestr, doing_tracks ? "-track" : "-route").arg(trk_count++, 4, 10, QChar('0'));
+    fout = gbfopen(ofname, "wb", MYNAME);
+  }
+  (void) track_recompute(rh);
+}
+
+static void
+gpssim_trk_ftr(const route_head*)
+{
+  if (splitfiles) {
+    gbfclose(fout);
+    fout = nullptr;
+  }
+}
+
+static void
+gpssim_write()
+{
+  if (waypt_count()) {
+    if (splitfiles) {
+      QString ofname = fnamestr + "-waypoints.gpssim";
+      fout = gbfopen(ofname, "wb", MYNAME);
+    }
+    if (wayptspd && wayptspd[0]) {
+      gpssim_write_spd(strtod(wayptspd, nullptr));
+    }
+    waypt_disp_all(gpssim_write_pt);
+    if (splitfiles) {
+      gbfclose(fout);
+      fout = nullptr;
+    }
+  }
+
+  doing_tracks = 1;
+  track_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
+
+  trk_count = 0;
+  doing_tracks = 0;
+  route_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
+}
+
+
+ff_vecs_t gpssim_vecs = {
+  ff_type_file,
+  { ff_cap_write, ff_cap_write, ff_cap_write },
+  nullptr,
+  gpssim_wr_init,
+  nullptr,
+  gpssim_wr_deinit,
+  nullptr,
+  gpssim_write,
+  nullptr,
+  &gpssim_args,
+  NULL_POS_OPS
+};
diff --git a/gpssim.cc b/gpssim.cc
deleted file mode 100644 (file)
index 322564b..0000000
--- a/gpssim.cc
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
-    Write points to Franson Technology GpsGate simulator
-
-    Copyright (C) 2006  Robert Lipe, robertlipe+source@gpsbabel.org
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-
- */
-
-
-#include "defs.h"
-#include <cmath>
-#include <cstdio>
-#include <cstdlib>
-#include "nmea.h"
-
-#define MYNAME "gpssim"
-
-static gbfile* fout;
-static char* wayptspd;
-static char* splitfiles_opt;
-static int splitfiles;
-static QString fnamestr;
-static int trk_count;
-static int doing_tracks;
-
-static
-QVector<arglist_t> gpssim_args = {
-  {
-    "wayptspd", &wayptspd, "Default speed for waypoints (knots/hr)",
-    nullptr, ARGTYPE_FLOAT, ARG_NOMINMAX, nullptr
-  },
-  {
-    "split", &splitfiles_opt, "Split input into separate files",
-    "0", ARGTYPE_BOOL, ARG_NOMINMAX, nullptr
-  },
-};
-
-/*
- * The only thing kind of odd about this format is the "split"
- * option.  There's some trashing about with the 'splitfiles' toggle
- * to ensure that waypoints land in one file and each track and each
- * route land in files of their own.
- */
-
-static void
-gpssim_wr_init(const QString& fname)
-{
-  fnamestr =  fname;
-  trk_count = 0;
-  splitfiles = splitfiles_opt ? xstrtoi(splitfiles_opt, nullptr, 10) : 0;
-
-  /* If writing to stdout, never split files */
-  if (0 == strcmp("-",splitfiles_opt)) {
-    splitfiles = 0;
-  }
-
-  if (!splitfiles) {
-    fout = gbfopen(fname, "wb", MYNAME);
-  }
-}
-
-static void
-gpssim_wr_deinit()
-{
-  if (fout) {
-    gbfclose(fout);
-    fout = nullptr;
-  }
-
-  fnamestr.clear();
-}
-
-
-/*
- * All these files are written in binary mode, so put CR/NL pairs
- * in them explictly in case we're writing from a UNIX-like host.
- */
-
-static void
-gpssim_write_sentence(const char* const s)
-{
-  gbfprintf(fout, "$%s*%02X\r\n", s, NmeaFormat::nmea_cksum(s));
-}
-
-static void
-gpssim_write_spd(double knotsperhour)
-{
-  char obuf[1024];
-
-  snprintf(obuf, sizeof(obuf), "FRSPD,%.2f", knotsperhour);
-  gpssim_write_sentence(obuf);
-}
-
-static void
-gpssim_write_pt(const Waypoint* wpt)
-{
-  char obuf[1024];
-
-  if (wpt->speed_has_value()) {
-    gpssim_write_spd(MPS_TO_KNOTS(wpt->speed_value()));
-  }
-
-  double lat = degrees2ddmm(wpt->latitude);
-  double lon = degrees2ddmm(wpt->longitude);
-
-  snprintf(obuf, sizeof(obuf), "FRWPT,%10.5f,%c,%011.5f,%c,%.1f",
-           fabs(lat), lat < 0 ? 'S' : 'N',
-           fabs(lon), lon < 0 ? 'W' : 'E',
-           wpt->altitude == unknown_alt ? 0 : wpt->altitude
-          );
-
-  if (wpt->creation_time.isValid()) {
-    char tbuf[20];
-
-    QByteArray dmy = wpt->GetCreationTime().toUTC().toString(u"ddMMyy").toUtf8();
-    QByteArray hms = wpt->GetCreationTime().toUTC().toString(u"hhmmss").toUtf8();
-
-    snprintf(tbuf, sizeof(tbuf), ",%s,%s",dmy.constData(), hms.constData());
-    strcat(obuf, tbuf);
-  }
-
-  gpssim_write_sentence(obuf);
-}
-
-static void
-gpssim_trk_hdr(const route_head* rh)
-{
-  if (splitfiles) {
-
-    if (fout) {
-      fatal(MYNAME ": output file already open.\n");
-    }
-
-    QString ofname = QStringLiteral("%1%2%3.gpssim").arg(fnamestr, doing_tracks ? "-track" : "-route").arg(trk_count++, 4, 10, QChar('0'));
-    fout = gbfopen(ofname, "wb", MYNAME);
-  }
-  (void) track_recompute(rh);
-}
-
-static void
-gpssim_trk_ftr(const route_head*)
-{
-  if (splitfiles) {
-    gbfclose(fout);
-    fout = nullptr;
-  }
-}
-
-static void
-gpssim_write()
-{
-  if (waypt_count()) {
-    if (splitfiles) {
-      QString ofname = fnamestr + "-waypoints.gpssim";
-      fout = gbfopen(ofname, "wb", MYNAME);
-    }
-    if (wayptspd && wayptspd[0]) {
-      gpssim_write_spd(strtod(wayptspd, nullptr));
-    }
-    waypt_disp_all(gpssim_write_pt);
-    if (splitfiles) {
-      gbfclose(fout);
-      fout = nullptr;
-    }
-  }
-
-  doing_tracks = 1;
-  track_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
-
-  trk_count = 0;
-  doing_tracks = 0;
-  route_disp_all(gpssim_trk_hdr, gpssim_trk_ftr, gpssim_write_pt);
-}
-
-
-ff_vecs_t gpssim_vecs = {
-  ff_type_file,
-  { ff_cap_write, ff_cap_write, ff_cap_write },
-  nullptr,
-  gpssim_wr_init,
-  nullptr,
-  gpssim_wr_deinit,
-  nullptr,
-  gpssim_write,
-  nullptr,
-  &gpssim_args,
-  NULL_POS_OPS
-};
index 6d10d5cd002623a044d36dd3f850b75825c81b42..f03faaf78c36bb072d4878e615fd8e67aeeeb799 100644 (file)
@@ -8,7 +8,6 @@ exif    jpg     Embedded Exif-GPS data (.jpg)
 shape  shp     ESRI shapefile
 igc            FAI/IGC Flight Recorder Data Format
 garmin_fit     fit     Flexible and Interoperable Data Transfer (FIT) Activity file
-gpssim gpssim  Franson GPSGate Simulation
 garmin301              Garmin 301 Custom position and heartrate
 garmin_g1000   csv     Garmin G1000 datalog input filter file
 gdb    gdb     Garmin MapSource - gdb
index cc4d87520687c62ea6308e37e7b755400bf2688a..424a81f7f90451ca0eb11e3888a0753b554a0ff5 100644 (file)
@@ -11,7 +11,6 @@ file  exif    jpg     Embedded Exif-GPS data (.jpg)
 file   shape   shp     ESRI shapefile
 file   igc             FAI/IGC Flight Recorder Data Format
 file   garmin_fit      fit     Flexible and Interoperable Data Transfer (FIT) Activity file
-file   gpssim  gpssim  Franson GPSGate Simulation
 file   garmin301               Garmin 301 Custom position and heartrate
 file   garmin_g1000    csv     Garmin G1000 datalog input filter file
 file   gdb     gdb     Garmin MapSource - gdb
index 7132352266702e29e6feed9c252caa926161d507..8ddca1773400379c4ba91ce312c3bef66330969c 100644 (file)
@@ -11,7 +11,6 @@ file  rw----  exif    jpg     Embedded Exif-GPS data (.jpg)
 file   rwrwrw  shape   shp     ESRI shapefile
 file   --rwrw  igc             FAI/IGC Flight Recorder Data Format
 file   -wrw--  garmin_fit      fit     Flexible and Interoperable Data Transfer (FIT) Activity file
-file   -w-w-w  gpssim  gpssim  Franson GPSGate Simulation
 file   rw----  garmin301               Garmin 301 Custom position and heartrate
 file   --rw--  garmin_g1000    csv     Garmin G1000 datalog input filter file
 file   rwrwrw  gdb     gdb     Garmin MapSource - gdb
index 70596a81f4c79c9c7c8ad62742fe106c1c09a0ee..ab9e479ece8aae5e6282d741ac8977336856db3f 100644 (file)
@@ -142,12 +142,6 @@ option     garmin_fit      allpoints       Read all points even if latitude or longitude is mis
 
 option garmin_fit      recoverymode    Attempt to recovery data from corrupt file      boolean                         https://www.gpsbabel.org/WEB_DOC_DIR/fmt_garmin_fit.html#fmt_garmin_fit_o_recoverymode
 
-file   -w-w-w  gpssim  gpssim  Franson GPSGate Simulation      gpssim
-       https://www.gpsbabel.org/WEB_DOC_DIR/fmt_gpssim.html
-option gpssim  wayptspd        Default speed for waypoints (knots/hr)  float                           https://www.gpsbabel.org/WEB_DOC_DIR/fmt_gpssim.html#fmt_gpssim_o_wayptspd
-
-option gpssim  split   Split input into separate files boolean 0                       https://www.gpsbabel.org/WEB_DOC_DIR/fmt_gpssim.html#fmt_gpssim_o_split
-
 file   rw----  garmin301               Garmin 301 Custom position and heartrate        xcsv
        https://www.gpsbabel.org/WEB_DOC_DIR/fmt_garmin301.html
 option garmin301       snlen   Max synthesized shortname length        integer         1               https://www.gpsbabel.org/WEB_DOC_DIR/fmt_garmin301.html#fmt_garmin301_o_snlen
index edac9da530eb4794c72a180f2e24ceb2e044e376..715be12bd7d7d3ff19a70dcc72ea8c2259d559f2 100644 (file)
@@ -79,9 +79,6 @@ File Types (-i and -o options):
        garmin_fit            Flexible and Interoperable Data Transfer (FIT) Act
          allpoints             (0/1) Read all points even if latitude or longitude is m
          recoverymode          (0/1) Attempt to recovery data from corrupt file
-       gpssim                Franson GPSGate Simulation
-         wayptspd              Default speed for waypoints (knots/hr)
-         split                 (0/1) Split input into separate files
        garmin301             Garmin 301 Custom position and heartrate
          snlen                 Max synthesized shortname length
          snwhite               (0/1) Allow whitespace synth. shortnames
diff --git a/testo.d/gpssim.test b/testo.d/gpssim.test
deleted file mode 100644 (file)
index 175c774..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Franson GPSGate simulation
-#
-gpsbabel -i geo -f ${REFERENCE}/geocaching.loc -o gpssim -F ${TMPDIR}/waypoints.gpssim
-compare ${TMPDIR}/waypoints.gpssim ${REFERENCE}
-gpsbabel -i gpx -f ${REFERENCE}/track/tracks.gpx -o gpssim -F ${TMPDIR}/tracks.gpssim
-compare ${TMPDIR}/tracks.gpssim ${REFERENCE}/track
-gpsbabel -i gpx -f ${REFERENCE}/track/nmeadate.gpx -o gpssim -F ${TMPDIR}/nmeadate.gpssim
-compare ${REFERENCE}/track/nmeadate.gpssim ${TMPDIR}/nmeadate.gpssim
-
diff --git a/vecs.cc b/vecs.cc
index a48a380aa19bda282b7b3242d0a9d2974bd90ce5..e91aa923abff0b78775b054a9643461762d32bb7 100644 (file)
--- a/vecs.cc
+++ b/vecs.cc
@@ -92,7 +92,6 @@ extern ff_vecs_t wbt_fvecs;
 //extern ff_vecs_t wbt_fvecs;
 extern ff_vecs_t vcf_vecs;
 extern ff_vecs_t gtm_vecs;
-extern ff_vecs_t gpssim_vecs;
 #if CSVFMTS_ENABLED
 extern ff_vecs_t garmin_txt_vecs;
 #endif // CSVFMTS_ENABLED
@@ -152,7 +151,6 @@ struct Vecs::Impl {
   LegacyFormat vcf_fmt {vcf_vecs};
   UnicsvFormat unicsv_fmt;
   LegacyFormat gtm_fmt {gtm_vecs};
-  LegacyFormat gpssim_fmt {gpssim_vecs};
 #if CSVFMTS_ENABLED
   LegacyFormat garmin_txt_fmt {garmin_txt_vecs};
 #endif // CSVFMTS_ENABLED
@@ -389,13 +387,6 @@ struct Vecs::Impl {
       "gtm",
       nullptr,
     },
-    {
-      &gpssim_fmt,
-      "gpssim",
-      "Franson GPSGate Simulation",
-      "gpssim",
-      nullptr,
-    },
 #if CSVFMTS_ENABLED
     {
       &garmin_txt_fmt,
diff --git a/xmldoc/formats/gpssim.xml b/xmldoc/formats/gpssim.xml
deleted file mode 100644 (file)
index 320c51d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-  <para>
-        This is a write-only format used to feed waypoints, tracks, and routes
-        into <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://franson.com/">Franson Technolgies'</link>
-        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://franson.com/gpsgate/">GpsGate simulator</link>.
-  </para>
-  <para>
-        To use these files in GpsGate, select 'Simulator' and then
-        "File-&gt;Open".
-  </para>
diff --git a/xmldoc/formats/options/gpssim-split.xml b/xmldoc/formats/options/gpssim-split.xml
deleted file mode 100644 (file)
index 26a5c9c..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<para>When this option is specified, GPSBabel will split
-        split the output into multiple files using the output filename
-        as a base.  For example, if you specify an output file of 'mytrip',
-<simplelist type="vert">
-  <member>mytrip-waypoints.gpssim - will contain the waypoints.</member>
-  <member>mytrip-track0000.gpssim - will contain the first track.</member>
-  <member>mytrip-track0001.gpssim - will contain the second track.</member>
-  <member>... and so on.</member>
-  <member>mytrip-route0000.gpssim - will contain the first route.</member>
-  <member>mytrip-route0001.gpssim - will contain the seconds route.</member>
-  <member>... and so on.</member>
-</simplelist>
-</para>
-
-<para>
-Valid values for this option are 0 (off) and 1 (on).  The default is '0'.
-</para>